package com.meixiang.adapter.personalCenter;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Environment;
import android.provider.MediaStore;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.meixiang.R;
import com.meixiang.dialog.SelectDialog;
import com.meixiang.global.Config;
import com.meixiang.util.AbToastUtil;
import com.meixiang.view.ClearEditText;
import com.meixiang.view.OrderLinearLayout;
import com.meixiang.view.StarLayout;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * @author Created at 2016/5/10 11:37
 */
public class AppointmentEvaluationAdapter extends RecyclerView.Adapter<AppointmentEvaluationAdapter.ViewHolder> {

    private Context context ;

    public AppointmentEvaluationAdapter(Context context){

        this.context = context ;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.activity_appointment_evalution_list_item
                ,parent,false);
        ViewHolder viewHolder=new ViewHolder(view);
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {

        holder.llPhotoPrint.setOnClickListener(onClickListener);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public int getItemCount() {
        return 1;
    }

    private View.OnClickListener onClickListener = new View.OnClickListener(){

        @Override
        public void onClick(View v) {
            switch (v.getId()){
                case R.id.appointment_sale_linear_photo_printing:
                    new SelectDialog(context, new String[]{"拍照上传", "相册选择"}, new SelectDialog.IResultListener() {
                        @Override
                        public void SelectResult(int result) {

                            if (result == 0) {
                                //拍照
                            } else {
                                //手机相册

                            }
                        }
                    });
                    break;
            }
        }
    };
    class ViewHolder extends RecyclerView.ViewHolder{
        @Bind(R.id.appointment_evaluation_iv_shopping)
        ImageView ivImageView ;
        @Bind(R.id.appointment_evaluation_tv_shopping_name)
        TextView tvName ;
        @Bind(R.id.appointment_evaluation_start)
        StarLayout mStart ;
        @Bind(R.id.appointment_evaluation_tv_start_details)
        TextView tvStartDetails ;
        @Bind(R.id.appointment_sale_et_problem_details)
        ClearEditText etSale ;
        @Bind(R.id.appointment_sale_linear_photo_printing)
        LinearLayout llPhotoPrint ;
        public ViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }

}
